localLoc
Type
function
Summary
Returns the equivalent, in relative coordinates|local coordinates, of a point given in absolute coordinates|global coordinates.
Syntax
the localLoc of <globalPoint>
localLoc(<globalPoint>)
Description
Use the localLoc function to translate between screen and window coordinates.
In window coordinates, the point 0,0 is at the top left of the stack window. In screen coordinates, the point 0,0 is at the top left of the screen.
The point returned by the localLoc function is relative to the top left of the current stack.
The first item of the returned value is the horizontal distance in pixels from the left edge of the current stack to the location given by globalPoint. The second item of the returned value is the vertical distance from the top edge of the current stack to the location given by globalPoint.
Parameters
Name | Type | Description |
---|---|---|
globalPoint | point | Any expression that evaluates to a point--a vertical and horizontal distance from the top left of the screen, separated by a comma. |
Examples
localLoc((90,174))
localLoc(the location of field 1)
Related
control structure: function
function: selectedLoc
glossary: relative coordinates, current stack, absolute coordinates, return, return value, integer, point
keyword: item, point, relative
Compatibility and Support
Introduced
LiveCode 1.0
OS
mac
windows
linux
ios
android
Platforms
desktop
server
mobile